package org.anyline.simple.datasource;


import org.anyline.service.AnylineService;
import org.anyline.util.ConfigTable;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.jdbc.core.JdbcTemplate;

import javax.sql.DataSource;
import java.util.Map;

@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
public class ClearApplication {

    public static void main(String[] args) throws Exception {
        SpringApplication application = new SpringApplication(ClearApplication.class);
        ConfigurableApplicationContext context = application.run(args);
        //这里可以验证一下 service 有没有成功注入
        AnylineService service = context.getBean(AnylineService.class);
        System.out.println(service);
        //{jdbcTemplate=org.springframework.jdbc.core.JdbcTemplate@24c685e7}
        //{dataSource=com.baomidou.dynamic.datasource.DynamicRoutingDataSource@7da635c0}
        ConfigTable.KEEP_ADAPTER = 2;
    }
}
